﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GalaxyTranslator.EntityDataModel;
using GalaxyTranslator.Model;
using GalaxyTranslator.Presenters;
using GalaxyTranslator.ViewInterfaces;

namespace GalaxyTranslator
{
    public partial class WebForm1 : System.Web.UI.Page, IOrderView
    {
        private OrderPresenter _presenter;
        
        public IList<Order> Orders
        {
            set
            {
                GridView1.DataSource = value;
                GridView1.DataBind();
            }
        }

        public string Status
        {
            get { return TextBox1.Text; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
	        InitView();
        }

        private void InitView()
        {
            _presenter = new OrderPresenter(this);
            _presenter.InitView(IsPostBack);
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            _presenter.AddNewOrder();
        }


    }
}